package com.example.demo.service.serviceImpl;

import com.example.demo.entity.LeveltwoLabel;
import com.example.demo.mapper.LeveltwoLabelMapper;
import com.example.demo.service.LeveltwoLabelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 标签表(LeveltwoLabel)Service层
 *
 * @author 杨丽辉
 * @since 2021-03-01 15:08:25
 */
@Service
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
public class LeveltwoLabelServiceImpl implements LeveltwoLabelService {
        @Autowired
        private LeveltwoLabelMapper leveltwoLabelMapper;


 /**
     * 通过ID和其他条件查询单条数据
     *
     * @param leveltwoLabel 实例对象
     * @return 实例对象
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
     public LeveltwoLabel queryLeveltwoLabelLimit1(LeveltwoLabel leveltwoLabel){
     return  leveltwoLabelMapper.queryLeveltwoLabelLimit1( leveltwoLabel);
     }
     
 /**
     * 查询指定行数据
     * @param leveltwoLabel 实例对象
     * @param offset 查询起始位置
     * @param limit 查询条数
     * @return 对象列表
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
  public   List<LeveltwoLabel> queryAllLeveltwoLabelByLimit( LeveltwoLabel leveltwoLabel, Integer offset,  Integer limit){
   return leveltwoLabelMapper.queryAllLeveltwoLabelByLimit(leveltwoLabel, offset,limit);
  }

  /**
     * 查询数据条数
     * @return 条数
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
   public int countAllLeveltwoLabel(LeveltwoLabel leveltwoLabel){
   return leveltwoLabelMapper.countAllLeveltwoLabel( leveltwoLabel);
   }
   /**
     * 通过实体作为筛选条件查询
     *
     * @param leveltwoLabel 实例对象
     * @return 对象列表
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
   public List<LeveltwoLabel> queryAllLeveltwoLabel(LeveltwoLabel leveltwoLabel){
   return leveltwoLabelMapper.queryAllLeveltwoLabel(leveltwoLabel);
   }
  /**
     * 新增数据
     *
     * @param leveltwoLabel 实例对象
     * @return 影响行数
     */
     @Override
   @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
    public int insertLeveltwoLabel(LeveltwoLabel leveltwoLabel){
    return  leveltwoLabelMapper.insertLeveltwoLabel( leveltwoLabel);
    }
  /**
     * 修改数据
     *
     * @param leveltwoLabel 实例对象
     * @return 影响行数
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
     public  int updateLeveltwoLabel(LeveltwoLabel leveltwoLabel){
         return leveltwoLabelMapper.updateLeveltwoLabel( leveltwoLabel);
     }

    /**
     * 通过主键删除数据
     * @param labelId 主键
     * @return 影响行数
     */
      @Override
  @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
   public  int deleteLeveltwoLabelById(String labelId){
   return  leveltwoLabelMapper.deleteLeveltwoLabelById( labelId);
   }
     /**
     * 通过主键列表删除，列表长度不能为0
     * @param list 集合
     * @return 条数
     */
      @Override
  @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
  public  int deleteLeveltwoLabelByIds( List<String> list){
    return  leveltwoLabelMapper.deleteLeveltwoLabelByIds(  list);
  }
    
       /**
     * 通过主键修改实体列表，列表长度不能为0，注意：当实体属性为null时，对应的列也会别更新为null
     * @param list 集合
     * @return 条数
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
   public int updateLeveltwoLabelBatch( List<LeveltwoLabel> list){
   return  leveltwoLabelMapper.updateLeveltwoLabelBatch(list);
   }
    /**
     * 批量其他列,除主键以外的列，列表长度不能为0,字段是空的就置为null
     * @param list 集合
     * @return 条数
     */
      @Override
  @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
 public   int insertLeveltwoLabelBatch( List<LeveltwoLabel> list){
 return leveltwoLabelMapper.insertLeveltwoLabelBatch( list);
 }
      /**
     * 通过实体非空属性删除
     * @param leveltwoLabel  实体
     * @return 条数
     */
        @Override
@Transactional(rollbackFor = {RuntimeException.class, Exception.class})
  public   int deleteLeveltwoLabelByEntity( LeveltwoLabel leveltwoLabel){
  return  leveltwoLabelMapper.deleteLeveltwoLabelByEntity(  leveltwoLabel);
  }
    /**
     * 通过实体不为空的属性作为筛选条件查询列表
     * @param leveltwoLabel  实体
     * @return list
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
   public  List<LeveltwoLabel> listLeveltwoLabelByEntity(LeveltwoLabel leveltwoLabel){
   return leveltwoLabelMapper.listLeveltwoLabelByEntity( leveltwoLabel);
   }

 /**
     * 新增实体属性不为null的列
     * @param leveltwoLabel  实体
     * @return 条数
     */
       @Override
 @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
   public  int insertLeveltwoLabelSelect( LeveltwoLabel leveltwoLabel){
      return leveltwoLabelMapper.insertLeveltwoLabelSelect( leveltwoLabel);

   }
   
      /**
     * 批量新增新增实体属性不为null的列
     * @param list  实体
     * @return 条数
     */
        @Override
@Transactional(rollbackFor = {RuntimeException.class, Exception.class})
  public  int insertLeveltwoLabelListSelect( List<LeveltwoLabel> list){

     return leveltwoLabelMapper.insertLeveltwoLabelListSelect( list);
      }
     /**
     * 通过实体不为空的属性作为筛选条件查询单个
     * @param leveltwoLabel  实体
     * @return 单个
     */
     @Override
   @Transactional(rollbackFor = {RuntimeException.class, Exception.class})
    public  LeveltwoLabel getLeveltwoLabelByEntity(LeveltwoLabel leveltwoLabel){
     return  leveltwoLabelMapper.getLeveltwoLabelByEntity(leveltwoLabel);
    }

}

